home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_10_12
/
1012074b
< prev
next >
Wrap
Text File
|
1992-10-11
|
499b
|
27 lines
/* find2.c: A case-insensitive substring search */
#include <stdio.h>
#include <string.h>
#define WIDTH 128
main(int argc, char *argv[])
{
char line[WIDTH], lline[WIDTH];
char *search_str;
if (argc == 1)
return 1; /* Search string required */
search_str = argv[1];
strlwr(search_str);
while (gets(line))
{
strlwr(strcpy(lline,line));
if (strstr(lline,search_str))
puts(line);
}
return 0;
}